<?php
namespace app\controller;

use app\BaseController;
use think\facade\Db;
use think\Request;
use think\exception\ValidateException;

class Follow extends BaseController
{
    //所有被关注人
    public function getFollowList()
    {
        $data = Db::name('follow')
            ->where('uid', '=', $this->uid)
            ->column('aid');
        if ($data) {
            $users = Db::name('members')
                ->where(['status'=>1,'id'=>['in',$data]])
                ->column('id, name, head');
            $users = array_values($users);
            return $this->outputJson('ok', 200, $users);
        } else {
            return $this->outputJson('暂无关注', 400);
        }

    }
}